home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CChoreQuartet 1.0.1 / CDisposerChore.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  867 b   |  53 lines  |  [TEXT/KAHL]

  1. /*
  2.  * CDisposerChore.c
  3.  *
  4.  * A chore that disposes of an object.  Assign this as
  5.  * an urgent chore.
  6.  *
  7.  * © Copyright 1992-93 by Jamie R. McCarthy.  All rights reserved.
  8.  * This code can be both distributed and used freely.
  9.  * Internet: k044477@kzoo.edu            AppleLink: j.mccarthy
  10.  *
  11.  */
  12.  
  13.  
  14.  
  15. /********************************/
  16.  
  17. #include "CDisposerChore.h"
  18.  
  19. /********************************/
  20.  
  21.  
  22.  
  23. void disposeViaUrgentChore(CObject *theDisposee)
  24. {
  25.     CDisposerChore *theChore;
  26.     theChore = new(CDisposerChore);
  27.     theChore->setDisposee(theDisposee);
  28.     gApplication->AssignUrgentChore(theChore);
  29. }
  30.  
  31.  
  32.  
  33. void CDisposerChore::Perform(long *maxSleep)
  34. {
  35.     ForgetObject(itsDisposee);
  36. }
  37.  
  38.  
  39.  
  40. void CDisposerChore::setDisposee(CObject *theDisposee)
  41. {
  42.     ASSERT(member(theDisposee, CObject));
  43.     itsDisposee = theDisposee;
  44. }
  45.  
  46.  
  47.  
  48. CObject *CDisposerChore::getDisposee(void)
  49. {
  50.     return itsDisposee;
  51. }
  52.  
  53.